package com.wsoft.bpm.query.node;

import com.wsoft.bpm.node.FormProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 开始事件请求类
 *
 * @Author zhonglj
 * @Date 2024-09-11 15:15
 */
@Getter
@Setter
@Accessors(chain = true)
public class TaskQuery implements BaseNode {
    @Schema(description = "唯一标识")
    private String id;
    @NotBlank(message = "模型id不能为空!")
    @Schema(description = "模型id")
    private String modelId;
    @Schema(description = "名称")
    private String name;
    @Schema(description = "文档描述")
    private String documentation;
    @Schema(description = "流程监听器")
    private List<ListenerQuery> listeners;
    @Schema(description = "是否通过验证")
    private boolean validated;
    @Schema(description = "优先级")
    private String priority;

    @Schema(description = "指定任务完成时间")
    private String dueDate;
    @Schema(description = "指定任务完成时间后执行动作")
    private String dueDateAction;
    @Schema(description = "跳过条件表达式")
    private String skipExpression;

    @NotBlank(message = "执行分类不能为空!")
    @Schema(description = "执行分类")
    private String executeCategory;

    @Schema(description = "任务执行人")
    private TaskExecuteQuery taskExecute;
    @Schema(description = "任务候选人")
    private TaskCandidateQuery taskCandidate;

    @Schema(description = "是否串行执行")
    private String isSequential;
    @Schema(description = "默认结束条件-同意率")
    private String defaultCompletionCondition;
    @Schema(description = "多实例结束条件-自定义")
    private String completionCondition;
    @Schema(description = "多实例集合")
    private List<String> collection;
    @Schema(description = "多实例集合表达式")
    private String collectionExpression;
    @Schema(description = "满足结束条件之后是否继续审批不跳转")
    private boolean completionContinue;


    @Schema(description = "动态上级审批类型")
    private String dynamicApprovalType;
    @Schema(description = "动态上级审批值")
    private String dynamicApprovalValue;

    @NotBlank(message = "选择分支类型不能为空!")
    @Schema(description = "选择分支类型")
    private String branchType;

    @NotNull(message = "可执行结果不能为空!")
    @Schema(description = "可执行结果")
    private List<String> operations;

    @Schema(description = "是否编辑表单")
    private String isEditForm;
    @Schema(description = "绑定动态表单")
    private String formKey;
    @Schema(description = "表单属性")
    private List<FormProperty> formProperties;

    @Schema(description = "动态上级列表")
    private List<String> dynamicLeaderIdList;
}
